package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the PRESENTANTE database table.
 * 
 */
@Embeddable
public class PresentantePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String numHojaPres;
	private String aaHojaPres;
	private String presOficRegId;
	private String presRegPubId;
	private String sistemaId;
	private String areaRegId;

    public PresentantePK() {
    }

	@Column(name="NUM_HOJA_PRES", unique=true, nullable=false, length=10)
	public String getNumHojaPres() {
		return this.numHojaPres;
	}
	public void setNumHojaPres(String numHojaPres) {
		this.numHojaPres = numHojaPres;
	}

	@Column(name="AA_HOJA_PRES", unique=true, nullable=false, length=4)
	public String getAaHojaPres() {
		return this.aaHojaPres;
	}
	public void setAaHojaPres(String aaHojaPres) {
		this.aaHojaPres = aaHojaPres;
	}

	@Column(name="PRES_OFIC_REG_ID", unique=true, nullable=false, length=2)
	public String getPresOficRegId() {
		return this.presOficRegId;
	}
	public void setPresOficRegId(String presOficRegId) {
		this.presOficRegId = presOficRegId;
	}

	@Column(name="PRES_REG_PUB_ID", unique=true, nullable=false, length=2)
	public String getPresRegPubId() {
		return this.presRegPubId;
	}
	public void setPresRegPubId(String presRegPubId) {
		this.presRegPubId = presRegPubId;
	}

	@Column(name="SISTEMA_ID", unique=true, nullable=false, length=3)
	public String getSistemaId() {
		return this.sistemaId;
	}
	public void setSistemaId(String sistemaId) {
		this.sistemaId = sistemaId;
	}

	@Column(name="AREA_REG_ID", unique=true, nullable=false, length=5)
	public String getAreaRegId() {
		return this.areaRegId;
	}
	public void setAreaRegId(String areaRegId) {
		this.areaRegId = areaRegId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PresentantePK)) {
			return false;
		}
		PresentantePK castOther = (PresentantePK)other;
		return 
			this.numHojaPres.equals(castOther.numHojaPres)
			&& this.aaHojaPres.equals(castOther.aaHojaPres)
			&& this.presOficRegId.equals(castOther.presOficRegId)
			&& this.presRegPubId.equals(castOther.presRegPubId)
			&& this.sistemaId.equals(castOther.sistemaId)
			&& this.areaRegId.equals(castOther.areaRegId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.numHojaPres.hashCode();
		hash = hash * prime + this.aaHojaPres.hashCode();
		hash = hash * prime + this.presOficRegId.hashCode();
		hash = hash * prime + this.presRegPubId.hashCode();
		hash = hash * prime + this.sistemaId.hashCode();
		hash = hash * prime + this.areaRegId.hashCode();
		
		return hash;
    }
}